package com.crungoo.springaop.adives;


import java.lang.reflect.Method;
import org.springframework.aop.ThrowsAdvice;

/**
 * ThrowsAdvice 什么都没有，为什么能执行到afterThrowing方法？
 *
 * <p>
 *     代理根据抛出的异常，判断我们声明的异常是不是相同
 * </p>
 * @author fujc-dev@qq.com
 * @date 2023/7/28 11:23
 */
public class MyThrowsAdvice implements ThrowsAdvice {


	public void afterThrowing(Method method, Object[] args, Object target, NullPointerException exception) throws Throwable {
		System.out.println("方法抛出异常后执行");
	}

}
